package com.matt.repository.teaching;

import com.matt.domain.Children;
import com.matt.domain.course.CoursePlan;
import com.matt.domain.teaching.CourseArea;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/1/19
 * *******************************
 */
public interface CourseAreaRepository extends JpaRepository<CourseArea, String>, JpaSpecificationExecutor<CourseArea> {

    CourseArea findByNameAndTypeNameAndAreaIdAndDeleted(String name, String typeName, String areaId, Boolean deleted);
    List<CourseArea> findByTypeNameAndAreaIdAndDeleted(String typeName, String areaId, Boolean deleted);
    List<CourseArea> findByTypeNameAndAreaIdAndDeletedOrderByTypeCodeDesc(String typeName, String areaId, Boolean deleted);
    CourseArea findTop1ByAreaIdOrderByTypeCodeDesc(String areaId);
    CourseArea findByVideoUrlLike(String videoUrl);

}
